var newVue = new Vue({
	el: '#main',
	data: {
		headerData:{
			'titleColor':'#555a5e',
			'title':'山威投票',
			'icon':false,
			'iconColor':'white',
			'titleIcon':'fa-plus-circle'
		},
		isLogin: true
	},
	mounted: function() {
		this.check();
	},
	methods: {
		go: function(number) {
			if(number == 2) {
				window.location.replace("https://www.maksdu.com/login/?redirect="+window.location);
			} else
				window.location.replace("voteBroke.html?view="+number);
		},
		check: function(){
			var token = util.local("token");
			console.info(token);
			var that =this;
            if(token) {
                $.ajax({
                    url: 'https://www.maksdu.com/app/sauth',
                    method: 'get',
                    headers: {
                        'request_access_token':token
                    },
                    success: function(result) {
                        if(result.code == 200) {
                            that.isLogin = true;
                        } else {
                            that.isLogin = false;
                        }
                    }
                })
            } else
                this.isLogin = false;
		},
	}
});